<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateVendaTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateVendaLabel_idVenda}" for="idVenda" />
                    <h:inputText id="idVenda" value="#{vendaController.selected.idVenda}" title="#{bundle.CreateVendaTitle_idVenda}" required="true" requiredMessage="#{bundle.CreateVendaRequiredMessage_idVenda}"/>
                    <h:outputLabel value="#{bundle.CreateVendaLabel_dataVenda}" for="dataVenda" />
                    <h:inputText id="dataVenda" value="#{vendaController.selected.dataVenda}" title="#{bundle.CreateVendaTitle_dataVenda}" required="true" requiredMessage="#{bundle.CreateVendaRequiredMessage_dataVenda}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateVendaLabel_perDesconto}" for="perDesconto" />
                    <h:inputText id="perDesconto" value="#{vendaController.selected.perDesconto}" title="#{bundle.CreateVendaTitle_perDesconto}" required="true" requiredMessage="#{bundle.CreateVendaRequiredMessage_perDesconto}"/>
                    <h:outputLabel value="#{bundle.CreateVendaLabel_cliente}" for="cliente" />
                    <h:selectOneMenu id="cliente" value="#{vendaController.selected.cliente}" title="#{bundle.CreateVendaTitle_cliente}" required="true" requiredMessage="#{bundle.CreateVendaRequiredMessage_cliente}">
                        <f:selectItems value="#{clienteController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{vendaController.create}" value="#{bundle.CreateVendaSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{vendaController.prepareList}" value="#{bundle.CreateVendaShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateVendaIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
